<?php
	$url = "#allUsers/";
	if(isset($filter)) {
		$url .= "filter/".$filter."/";
	}
	if(isset($sortby)) {
		$url .= "sortby/$sortby/";	
	}
	$url.="page/"
?>

						<ul class="breadcrumb well">
						    <li><a href="index.html">Менеджмент</a> <span class="divider">/</span></li>
						    <li class="active">Все партнеры</li>
					    </ul>

					    <div class="content">
					    	<h2> Партнеры компании </h2>

					    	<table class="table table-hover">
					    		<thead>
						    		<tr>
						    			<td>
						    				Наименование
						    			</td>
						    			<td>
						    				E-mail
						    			</td>
						    			<td>
						    				Телефон
						    			</td>
						    			<td>
						    				Менеджер
						    			</td>
						    			<td>
						    				Операции
						    			</td>
						    		</tr>
					    		</thead>

					    		<tbody>
					    			<?php foreach($partners as $partner){ 
					    				if(isset($filter)){
						    	    			if($filter == "me"){
						    	    				if($partner->cmid != $session_id){
						    	    					continue;
						    	    				}
						    	    			}
						    	    		}

					    				?>
					    			<tr>
						    			<td>
								    		<?php echo $partner->name;?>
								    	</td>
								    	<td>
								    		<?php echo $partner->email;?>
								    	</td>
								    	<td>
								    		<?php echo $partner->tel;?>
								    	</td>
						    			<td>
						    				<?php echo $partner->mname;?>
						    			</td>
						    			<td>
						    				<div class="dropdown">
						    					<a class="dropdown-toggle btn" data-toggle="dropdown">Операции <b class="caret"></b> </a>

						    					<ul class="dropdown-menu">
						    						<li><a href="#deletePartner/id/<?php echo $partner->id; ?>"><i class="icon-trash"></i> Удалить</a></li>
						    						<li><a href="#editPartner/id/<?php echo $partner->id; ?>"><i class="icon-edit"></i> Изменить</a> </li>
						    					</ul>
						    				</div>


						    			</td>
						    		</tr>						   
									<?php } ?>
					    		</tbody>
					    	</table>
					    </div> <!-- /content -->

					    <!-- pagination -->
					    <?php include("pagination.php");?>